# script0903.py - Populate the Record High Temps (F) Dictionary
#		- Determine Max/Min/Mode of High Temps
# Author: Blum and Bresnahan
# Date:  May
################################################################
#
# Populate dictionary for Record High Temps (F) during May in Indianapolis
print()
print("Enter the record high temps (F) for May in Indianapolis...")
#
may_high_temp={}		   #Create empty dictionary
#
for may_date in range(1, 31 + 1):  #Loop to enter temps
#
	# Obtain record high temp for date
	prompt="Record high for May " + str(may_date) + ": "
	record_high=int(input(prompt))
        #
	# Put element in dictionary
	may_high_temp[may_date]=record_high
#
###########################################################
# Determine Maximum, Minimum, and Mode Temps
#
temp_list=may_high_temp.values()
max_temp=max(temp_list)          #Determine maximum high temp
min_temp=min(temp_list)          #Determine minimum high temp
#
# Determine mode (most common) high temp ###
#
# Import Counter function
from collections import Counter
# 
# Count temps and take the most frequent (mode) temperature
mode_list=Counter(temp_list).most_common(1)
#
# Extract mode high temp from 2-dimensional mode list
mode_temp=mode_list[0][0]
#
print()
print("Maximum high temp in May:\t", max_temp,"F")
print("Minimum high temp in May:\t", min_temp,"F")
print("Mode high temp in May:\t\t", mode_temp,"F")
#
######################################################### 
